package com.lz.type.google;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * GsonDemo..
 *
 * @author Lizhong
 * @date 2019/9/10
 */
public class GsonDemo {
    static Map <String ,Integer> map=new HashMap<>();

    public static void main(String[] args) {
        String s="{\"张三\":15}";
        Gson gson = new Gson();
        Map map0 = gson.fromJson(s, map.getClass());
        System.out.println("map.size:"+map0.size());
    }
    private static final class MapTypeToken extends TypeToken<Map<String, Object>> {

    }

    private static final class ListTypeToken extends TypeToken<List<Object>> {

    }
}
